<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'list.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script language="JavaScript" src="${contextPath }/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
 function xg(id){
	  window.location.href = "${contextPath }/user/toUpdate?id="+id;
 }
 function del(id){
	 $.ajax({
	     type: "POST",
	     url: "${contextPath }/user/delete",
	     data: {id:id},
	     success: function (data) {
	         alert(data.msg);
	         window.location.href = "${contextPath }/user";
	     },
	     error: function(data) {
	         alert("error");
	      }
	 });
 }
 <%--
 $.ajax({
     type: "POST",
     url: "${contextPath }/user/t",
     data: {id:id},
     success: function (data) {
         alert("111");
     },
     error: function(data) {
         alert("error");
      }
 });

--%></script>
</head>

<body>
	<a href="${contextPath }/user/toAdd">添加</a>
	<br />
	<table>
		<c:forEach items="${userlist }" var="u">
			<tr>
				<td>用户id：${u.id }</td>
				<td>密码 ： ${u.pwd }</td>
				<td>电话 ： ${u.tel }</td>
				<td>电话 ： ${u.name }</td>
				<td>时间：${u.addTime }</td>
				<td>角色：${u.roleID }</td>
				<td>状态：${u.status }</td>
				<td><a href="javascript:xg('${u.id }')">修改</a> | <a href="javascript:del('${u.id }')">删除</a></td>
			</tr>
		</c:forEach>
		第${maps.pageNum }页   共 ${maps.toalPage }页  ${maps.toalRow }行   每页显示${maps.pageSize }
	</table>
</body>
</html>
